This section describes inheritance variables and the associated commands.
Inheritance variables are variables that can be transferred from a parent session Uproc to child session Uprocs. As oppose to Uproc variables, inheritance variables do not have a size limit and do not have to be declared in the Uproc settings. Once an inheritance variable is entered in the Uproc script it is automatically transferred to the child Uproc when the session is run.
All Uproc types do not support inheritance variables.
The following Uprocs types support inheritance variables: WS_SOAP, WS_REST, ODB_JOB, ODB_TPL, CL_INT, CL_EXT, MSSQL, MSSQL_REF.
For Web services REST and SOAP type Uprocs, inheritance variables can be created through UVC as output variables. For more information, refer to the Dollar Universe Manager for Web Services User Guide.
The following Uprocs types do not support inheritance variables: CMD, EJB, FTP_GET, FTP_PUT, JMS_SEND, OAPP_PGM, OAPP_SET, SAP_IPACK, SAP_PCHAIN, SAP_XBP2, ZOS.
The uxset inheritance keep|discard command specifies whether input variables are transferred to the child Uprocs or not. Its syntax is as follows:
uxset inheritance keep|discard
The uxset hvar command can be used to create an inheritance variable, assign a value to this variable and specify that this variable will be transferred to the child Uprocs. Its syntax is as follows:
uxset hvar VAR=VAL
The uxunset hvar command specifies which variables will not be transferred to the child Uprocs. Its syntax is as follows:
uxunset hvar VAR
Description of Items
keep | discard
VAR=VAL
VAR is the variable’s name and VAL is the value which will be transmitted to the child Uproc.
With the command uxset hvar the variable's value can be assigned through a text file:
text_file.txt | uxset hvar VAR1 VAR2=value VAR3
VAR2 will be assigned “value” and VAR1 and VAR3 will be assigned the content of the file text_file.txt. There is no specific format for entering values into a text file.
Example of content in a text file:
Paris, France
2013/09/17
Val1, Val2, Val3
If several variables are to be transmitted they should be separated by spaces.
uxset hvar VARDATE=2013/08/16 “VARTXT=TEXT VALUE" VARNUM=555
The " " enclosing the variable “VARTXT” is needed to carry over the space in the string "TEXT VALUE"; if you don't have a space in your string they are not needed.
Constraints on the variable value
During the transmission to the next Uproc, inheritance variables are created as environment variables into the system (by the u_batch of the next Uproc), so the value of an inheritance variable has to contain the same characters than the ones authorized for the value of an environment variable on the given OS (the command set is used to set an environment variable for Windows, and the command export is used for UNIX). Otherwise, the inheritance variable cannot be created as an environment variable by the system, and the Uproc aborts.
Example 1: The following inheritance variables set into the script of a Uproc are correct:
uxset hvar "MY_VAR1=email<who@hello.com>"
or
uxset hvar MY_VAR1="email<who@hello.com>"
This variable will be created as an environment variable on the system by DUAS. This corresponds to the following correct system commands:
On Windows:
C:\>set MY_VAR1="email<who@hello.com>"
On UNIX:
root@myunixmachine:/# export MY_VAR1="email<who@hello.com>"
Example 2: The following inheritance variable set into the script of a Uproc is not correct:
uxset hvar MY_VAR1=email<toto@hello.com>
This variable cannot be created as an environment variable by DUAS. This corresponds to the following incorrect system commands:
On Windows:
C:\>set MY_VAR1=email<who@hello.com>
The syntax of the command is incorrect
On UNIX:
root@myunixmachine:/# export MY_VAR1=email<who@hello.com>
-bash: syntax error near unexpected token `newline'
If the value contains non alphanumeric characters, these characters must be preceded by the "\" character.
Display of Inheritance Variables
With the exception of WS_SOAP and WS_REST type Uprocs, inheritance variables are not listed in UVC. To view the transmitted variables, open the job log of the child Uproc.
Example:
$!** INHERITANCE VARIABLES
var1: val12345
_!================================================
If the option to keep the variables is activated (by default or command uxset inheritance keep), inheritance variables will be transmitted. If the option to keep the variables is deactivated (command uxset inheritance discard), the variables will not be transmitted to the child Uproc.
If the user references a variable that already exists (name conflict), the variable's value set in the category with a higher priority (1 is the highest) is selected. The categories are the following:
Examples
We have three Uprocs in a session (A, B and C). A is the parent Uproc and B and C are the child Uprocs. Run the following command in the script of Uproc A to generate inheritance variables:
uxset hvar Var1=Val1A Var2=Val2A Var3=Val3A
Uproc A variables: Var1=Val1A, Var2=Val2A, Var3=Val3A
In this configuration, be default the variables Var1, Var2 and Var3 and their values will be transmitted to all child Uprocs in the Session.
If the command “uxset inheritance discard” is executed in the script of Uproc A, no input variables will be transferred to Uproc B.
If the command “uxset inheritance keep” is executed in the script of Uproc A, Uproc B will receive all transferred input variables.
If the command “uxunset hvar Var1 Var3” is executed in the script of Uproc A, Uproc B will just receive the variable Var2 with the value “Val2A”.